///////////////////////////////////////////////////////////////////////////////
//// README file for “Social Image, Networks, and Protest Participation”
//// By Ruben Enikolopov, Alexey Makarin, Maria Petrova, and Leonid Polishchuk
///////////////////////////////////////////////////////////////////////////////

The following diagram shows the levels of the project tree structure at a high level.

Project_Folder/
	- README.pdf
	- Code/
		o ado/
		o pathnames.do
		o Master_file.do
	- Data/
	- Exhibits/

Before running the code, it is necessary to update the global paths in the pathnames.do file for the relevant file structure on your computer. It is only necessary to update the global $PROJ with the location of the project folder. Then use the do-file “Master_file.do” in the “Code” directory to run all of the analysis code. For the results to be consistent across machines, the code refers to the ado files in the “code/ado” directory. Running "Master_file.do" generates all the output tables and figures in the Exhibits folder.

The code was last run on a Intel(R) Core(TM) Ultra 7 155H 1.40 GHz with 32 GB of RAM and 871 GB of free disk space on Windows 11. Total run time for the code is approximately 10 minutes. 

More details on each dta and do-file below.

Stata do-files:
1. Master_file.do -- runs the analysis code 
2. Figures_MainText.do -- replicates the figures in the main text
3. Tables_MainText.do -- replicates the tables in the main text
4. Figures_Appendix.do -- replicates the figures in the online appendix
5. Tables_Appendix.do -- replicates the tables in the online appendix
6. pathnames.do -- sets the global directories 

R scripts:
1. figure_c2.R -- replicates Figure C2 in the paper.
2. table_c3.R -- replicates Table C3 in the paper.

Datasets:
1. data_protests_final.dta -- raw data on protests across Russian cities in 2011-2012, used for the construction of Figure D1.
2. data_crosscity_analysis_final.dta -- city-level data used for all the figures and tables related to cross-city analysis.
3. data_list_experiment_final.dta -- survey data used for all the figures and tables related to a list experiment.
4-5. data_list_experiment_for_R_final.xlsx and data_list_experiment_for_R_final.csv -- auxiliary datasets containing the survey data used for Figure C2 and Table C3 constructed in R.


NOTE: Results were obtained using the following versions of STATA packages (for convenience, they are present in the /ado folder and are called upon by the master do-file):
- avar 1.0.07 28July2015
- ranktest 1.4.01 18aug2015
- ivreg2 2.2.08 15oct2007 [Can be installed by typing "search ivreg2" and selecting the "SJ-7-4" package. We use the older version of ivreg2 because more modern versions of the program struggle with inverting our matrix of covariates with the fifth polynomial of population due to high degree of collinearity. With other packages, such as avar and ranktest, being up to date, this choice does not affect the quality of our statistical inference and weak IV testing.]